<?php
class Catalog_Form_SpecialEditing extends Zend_Form
{
    public function init()
    {
        $this->setMethod('post');


        // Add Element Date Picker
        $elem = new ZendX_JQuery_Form_Element_DatePicker(
              "start_at", array("label" => "From")
        );
        $elem->setRequired();
        $elem->addValidator('Date');
        $elem->addValidator(new Areal_Validate_DateLessOrEqualThan('end_at'));
        $elem->setJQueryParam('dateFormat', 'yy-mm-dd');
        $this->addElement($elem);

        // Add Element Date Picker
        $elem = new ZendX_JQuery_Form_Element_DatePicker(
              "end_at", array("label" => "Till")
        );
        $elem->setRequired();
        $elem->addValidator('Date');
        $elem->setJQueryParam('dateFormat', 'yy-mm-dd');
        $this->addElement($elem);

        $this->addElement('text', 'price', array(
            'label'      => 'Price',
            'required'   => true,
            'validators' => array('Float')
        ));

        $this->addElement('submit', 'submit', array(
            'label'    => 'Save',
        ));
    }
}
